﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.mysql
{
	// Token: 0x0200015F RID: 351
	public class TMySQLWhileStmt : TBlockSqlStatement
	{
		// Token: 0x06000BF2 RID: 3058 RVA: 0x00306C50 File Offset: 0x00304E50
		public TMySQLWhileStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstmysqlwhilestmt;
		}

		// Token: 0x06000BF3 RID: 3059 RVA: 0x00306C64 File Offset: 0x00304E64
		internal override void buildsql()
		{
		}

		// Token: 0x06000BF4 RID: 3060 RVA: 0x00306C66 File Offset: 0x00304E66
		internal override void clear()
		{
		}

		// Token: 0x06000BF5 RID: 3061 RVA: 0x00306C68 File Offset: 0x00304E68
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06000BF6 RID: 3062 RVA: 0x00306C6F File Offset: 0x00304E6F
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x06000BF7 RID: 3063 RVA: 0x00306C74 File Offset: 0x00304E74
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TWhileSqlNode twhileSqlNode = (TWhileSqlNode)this.rootNode;
			base.doParseStatement(psql);
			this.condition = twhileSqlNode.Condition;
			twhileSqlNode.Stmts.doParse(this, ESqlClause.unknown);
			for (int i = 0; i < twhileSqlNode.Stmts.size(); i++)
			{
				this.BodyStatements.add(twhileSqlNode.Stmts.getStatementSqlNode(i).Stmt);
			}
			return 0;
		}

		// Token: 0x1700022F RID: 559
		// (get) Token: 0x06000BF8 RID: 3064 RVA: 0x00306CEB File Offset: 0x00304EEB
		// (set) Token: 0x06000BF9 RID: 3065 RVA: 0x00306CF3 File Offset: 0x00304EF3
		public virtual TExpression Condition
		{
			get
			{
				return this.condition;
			}
			set
			{
				this.condition = value;
			}
		}

		// Token: 0x06000BFA RID: 3066 RVA: 0x00306CFC File Offset: 0x00304EFC
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000BFB RID: 3067 RVA: 0x00306D0C File Offset: 0x00304F0C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.BodyStatements.accept(v);
			v.postVisit(this);
		}

		// Token: 0x040012CA RID: 4810
		private TExpression condition;
	}
}
